home *** CD-ROM | disk | FTP | other *** search
XSetup plugin | 2001-01-21 | 2.9 KB | 108 lines |
- "FILE"="Xteq Systems X-Setup Plugin 5.0"
- "TYPE"="5"
- "COUNT"="1"
- "UIPATH"="Appearance\Files&Folders\"New" Context Menu"
- "NAME"="Add Item"
- "VERSION"="1.00"
- "LANGUAGE"="VBScript"
- "TEXT 1"="Add Item to NEW Context Menu"
- "DESCRIPTION 1"="This plug-in allows you to add a new file type that is currently not listed inside the NEW menu."
- "DESCRIPTION 2"="Please enter the file extension without the beginning ".", e.g. "TXT" (no quotes)."
- "AUTHOR"="Xteq Systems"
- "CONTACTURL"="http://www.xteq.com"
- "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
- "COMMENT 1"=" "
-
-
- sP="HKLM\Software\Classes\"
- sV_ShellNew="\ShellNew\"
-
-
-
- Sub Plugin_Initialize
- if RegPathExists(sP) then
- '
- else
- Call Disable
- end if
- End Sub
-
- Sub Plugin_Apply(ElementIndex,ElementSubIndex)
- if ElementIndex=1 then
- s=InputWindow("Please enter the extension of the file type, without the beginning dot, e.g. TXT","TXT",1)
- if IsEmpty(s)=false then
- sPath=IsShellNew(sP & "." & s)
-
- if len(sPath)>0 then
- Call MsgError("This file type is already registered for use with the NEW context menu and can therefore not be added!")
- else
- If RegPathExists(sP & "." & s)=false then
- Call MsgError("This file type is not known to your system can therefore not be added!")
- else
- sPath=sP & "." & s & sV_ShellNew & "NullFile"
- Call RegWriteValue(sPath,"",1)
- end if
- end if
- end if
- end if
-
- End Sub
-
-
-
-
-
-
- 'VERSION 1.1
- 'returns the reg path to the ShellNew(-) path or "" if nothing was found. Input is the
- 'path to the data type (e.g. "HKCR\.TXT").
- Function IsShellNew(Path)
- Dim sCheck
- xd_sV_ShellNew="\ShellNew"
- xd_sV_ShellNewDeac="\ShellNew-"
-
-
- 'first check on the file itself
- 'HKCR\.XXX\ShellNew
- sCheck=Path & xd_sV_ShellNew
- If RegPathExists(sCheck) then
- IsShellNew=sCheck
- else
- 'now check if it's deactivated...
- 'HKCR\.XXX\ShellNew
- sCheck=Path & xd_sV_ShellNewDeac
- If RegPathExists(sCheck) then
- IsShellNew=sCheck
- else
- 'maybe it's a little trick file
- s=RegReadValue(Path & "\@")
- if IsEmpty(s)=false then
- 'HKCR\.XXX\XX File\ShellNew
- sCheck=Path & "\" & s & xd_sV_ShellNew
- if RegPathExists(sCheck) then
- IsShellNew=sCheck
- else
- 'maybe deactivated?
- sCheck=Path & "\" & s & xd_sV_ShellNewDeac
- if RegPathExists(sCheck) then
- IsShellNew=sCheck
- else
- 'okay, I give up! I have checked all possibilies...
- IsShellNew=""
- end if
- end if
- else
- 'this value has no name, so it has no ShellNew(-) key..
- IsShellNew=""
- end if
- end if
- end if
-
- End Function
-
-
-
-
- Sub Plugin_Terminate
- End Sub
-